<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>Interpolator1 (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>

  <script type="text/javascript" src="//www.google.com/jsapi"></script>
  <script type="text/javascript">
     google.load("visualization", "1", {packages:["orgchart"]});
     var _loadingVisualizations = true;
  </script>

  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
        <span class="fn">math.interpolator.Interpolator1</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    An interface for one dimensional data interpolation.

  </div>


        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_math_interpolator_interpolator1.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/math/interpolator/interpolator1.js">Git</a></li>
          </ol>
        </div>
</div>






<h2 class="g-first">Inheritance</h2>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
  <tr><td>goog.math.interpolator.Interpolator1</td><td></td></tr>
</table>
</div>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
</table>
</div>




  <h2>Constructor</h2>
      <div class="fn-constructor">
    goog.math.interpolator.Interpolator1(<span></span>)
  </div>



<h2>Instance Methods</h2>


  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="interface_goog_math_interpolator_Interpolator1.html">
              goog.math.interpolator.Interpolator1
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.interpolator.Interpolator1.prototype.getInverse"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getInverse<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="interface_goog_math_interpolator_Interpolator1.html">goog.math.interpolator.Interpolator1</a></span>
      </div>


     <div class="entryOverview">
       Computes the inverse interpolator. That is, it returns invInterp s.t.
this.interpolate(invInterp.interpolate(t))) = t. Note that the inverse
interpolator is only well defined if the data being interpolated is
'invertible', i.e. it represents a bijective function.
In addition, the returned interpolator is only guaranteed to give the exact
inverse at the input data passed in getData.
If 'this' has no data, the returned Interpolator will be empty as well.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="interface_goog_math_interpolator_Interpolator1.html">goog.math.interpolator.Interpolator1</a></span>&nbsp;
            The inverse interpolator.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_interpolator_interpolator1.js.source.html#line64">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.interpolator.Interpolator1.prototype.interpolate"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">interpolate<span class="args">(<span class="arg">x</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Computes the interpolated value at abscissa x. If x is outside the range
of the data points passed in setData, the value is extrapolated.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">x</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The abscissa to sample at.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The interpolated value at abscissa x.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_interpolator_interpolator1.js.source.html#line51">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.interpolator.Interpolator1.prototype.setData"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">setData<span class="args">(<span class="arg">x</span>,&nbsp;<span class="arg">y</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets the data to be interpolated. Note that the data points are expected
to be sorted according to their abscissa values and not have duplicate
values. E.g. calling setData([0, 0, 1], [1, 1, 3]) may give undefined
results, the correct call should be setData([0, 1], [1, 3]).
Calling setData multiple times does not merge the data samples. The last
call to setData is the one used when computing the interpolation.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">x</span>
        : <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;
        <div class="entryOverview">The abscissa of the data points.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">y</span>
        : <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;
        <div class="entryOverview">The ordinate of the data points.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_interpolator_interpolator1.js.source.html#line42">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




















<div class="section">
  <table class="horiz-rule">


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package math.interpolator</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="math.interpolator.Interpolator1"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
